package camel.corp.universalcopy;

import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import androidx.appcompat.app.o;
import com.camel.corp.universalcopy.SettingsActivity;
import com.camel.corp.universalcopy.a.k;

public class SettingsActivity extends k {
  private boolean a(Context paramContext) {
    stringBuilder1 = new StringBuilder();
    stringBuilder1.append(getPackageName());
    stringBuilder1.append("/");
    stringBuilder1.append(com.camel.corp.universalcopy.UniversalCopyService.class.getCanonicalName());
    String str = stringBuilder1.toString();
    try {
      int i = Settings.Secure.getInt(paramContext.getApplicationContext().getContentResolver(), "accessibility_enabled");
      try {
        stringBuilder1 = new StringBuilder();
        stringBuilder1.append("accessibilityEnabled = ");
        stringBuilder1.append(i);
        Log.v("universal_copy", stringBuilder1.toString());
      } catch (android.provider.Settings.SettingNotFoundException stringBuilder1) {}
    } catch (android.provider.Settings.SettingNotFoundException stringBuilder1) {
      boolean bool = false;
    } 
    StringBuilder stringBuilder2 = new StringBuilder();
    stringBuilder2.append("Error finding setting, default accessibility to not found: ");
    stringBuilder2.append(stringBuilder1.getMessage());
    Log.e("universal_copy", stringBuilder2.toString());
  }
  
  public void a(boolean paramBoolean) {
    Fragment fragment = getFragmentManager().findFragmentById(16908290);
    if (fragment instanceof k.a)
      ((k.a)fragment).a(paramBoolean); 
  }
  
  protected void onCreate(Bundle paramBundle) { // Byte code:
    //   0: aload_0
    //   1: aload_1
    //   2: invokespecial onCreate : (Landroid/os/Bundle;)V
    //   5: aload_0
    //   6: invokestatic getDefaultSharedPreferences : (Landroid/content/Context;)Landroid/content/SharedPreferences;
    //   9: astore #5
    //   11: iconst_0
    //   12: istore #4
    //   14: aload #5
    //   16: ldc 'night_mode'
    //   18: iconst_0
    //   19: invokeinterface getBoolean : (Ljava/lang/String;Z)Z
    //   24: ifeq -> 32
    //   27: iconst_2
    //   28: istore_2
    //   29: goto -> 34
    //   32: iconst_m1
    //   33: istore_2
    //   34: iload_2
    //   35: invokestatic d : (I)V
    //   38: iload #4
    //   40: istore_3
    //   41: aload #5
    //   43: ldc 'accessibility_active'
    //   45: iconst_0
    //   46: invokeinterface getBoolean : (Ljava/lang/String;Z)Z
    //   51: ifeq -> 71
    //   54: iload #4
    //   56: istore_3
    //   57: aload_0
    //   58: aload_0
    //   59: invokespecial a : (Landroid/content/Context;)Z
    //   62: ifne -> 71
    //   65: iconst_1
    //   66: istore_3
    //   67: aload_0
    //   68: invokestatic a : (Landroid/content/Context;)V
    //   71: new android/os/Bundle
    //   74: dup
    //   75: invokespecial <init> : ()V
    //   78: astore #5
    //   80: aload_1
    //   81: ifnull -> 108
    //   84: aload_0
    //   85: invokevirtual getFragmentManager : ()Landroid/app/FragmentManager;
    //   88: aload_1
    //   89: ldc 'current_fragment'
    //   91: invokevirtual getFragment : (Landroid/os/Bundle;Ljava/lang/String;)Landroid/app/Fragment;
    //   94: astore_1
    //   95: aload_1
    //   96: ifnull -> 108
    //   99: aload_1
    //   100: invokevirtual getArguments : ()Landroid/os/Bundle;
    //   103: astore #5
    //   105: goto -> 110
    //   108: aconst_null
    //   109: astore_1
    //   110: aload #5
    //   112: ldc 'accessibility_was_reset'
    //   114: iload_3
    //   115: invokevirtual putBoolean : (Ljava/lang/String;Z)V
    //   118: aload_1
    //   119: astore #6
    //   121: aload_1
    //   122: ifnonnull -> 141
    //   125: new com/camel/corp/universalcopy/ga
    //   128: dup
    //   129: invokespecial <init> : ()V
    //   132: astore #6
    //   134: aload #6
    //   136: aload #5
    //   138: invokevirtual setArguments : (Landroid/os/Bundle;)V
    //   141: aload_0
    //   142: invokevirtual getFragmentManager : ()Landroid/app/FragmentManager;
    //   145: invokevirtual beginTransaction : ()Landroid/app/FragmentTransaction;
    //   148: ldc 16908290
    //   150: aload #6
    //   152: invokevirtual replace : (ILandroid/app/Fragment;)Landroid/app/FragmentTransaction;
    //   155: invokevirtual commitAllowingStateLoss : ()I
    //   158: pop
    //   159: return }
  
  public boolean onCreateOptionsMenu(Menu paramMenu) {
    getMenuInflater().inflate(2131558401, paramMenu);
    return true;
  }
  
  public boolean onOptionsItemSelected(MenuItem paramMenuItem) {
    byte b;
    if (paramMenuItem.getItemId() != 2131296447)
      return super.onOptionsItemSelected(paramMenuItem); 
    boolean bool = paramMenuItem.isChecked() ^ true;
    paramMenuItem.setChecked(bool);
    PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean("night_mode", bool).apply();
    if (bool) {
      b = 2;
    } else {
      b = -1;
    } 
    o.d(b);
    return true;
  }
  
  public boolean onPrepareOptionsMenu(Menu paramMenu) {
    boolean bool = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("night_mode", false);
    paramMenu.findItem(2131296447).setChecked(bool);
    return super.onPrepareOptionsMenu(paramMenu);
  }
  
  protected void onSaveInstanceState(Bundle paramBundle) {
    Fragment fragment = getFragmentManager().findFragmentById(16908290);
    if (fragment != null)
      getFragmentManager().putFragment(paramBundle, "current_fragment", fragment); 
    super.onSaveInstanceState(paramBundle);
  }
}


/* Location:              D:\Users\alienware\AndroidStudioProjects\Lazero\sample\sampler\classes-dex2jar\com\camel.jar!\camel\cor\\universalcopy\SettingsActivity.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.0.7
 */